package com.seek.service;

import com.alibaba.fastjson.JSONObject;
import com.seek.core.BaseService;
import com.seek.model.dto.ResultInfo;
import com.seek.model.entity.TLoan;
import com.seek.model.entity.TLoanRepayment;

public interface LoanService extends BaseService<TLoan> {
	public ResultInfo addLoan(JSONObject reqJson) throws Exception;
	
	// 把货款订单分配给催收员
	public void assignLoanOverdue(JSONObject reqJson) throws Exception;
	
	// 添加催收日志
	public void addLoanOverdueLog(Long loanId, String remark, String nextOverdueTime, String userId) throws Exception;
	
	// 添加滞纳金减免记录
	public void addLatefeeReduceLog(Long loanId, String remark, int money, String userId) throws Exception;
	
	// 添加手工还款记录
	public void addLoanHandPay(Long companyId, Long loanId, int money, int latefee, String userId,String payor, String img) throws Exception;
	
	// 更新客户缓存中的已使用额度
	public void refreshCachedUsedCredit(Long loanId) throws Exception;
	
	// 生成贷款的滞纳金记录
	public void genLoanLateFee() throws Exception;
	
	// 根据借款金额计算手续费
	public int getHandleFee(Long companyId, int reqMoney) throws Exception;
	
	// 订单还款或续借成功后的业务处理	
	public void loanPayBack(TLoanRepayment repayment, String payNo) throws Exception;
	
	//修改tloan表里面的executionstatus字段为1
	public void updateTloan(int id,int status) throws Exception;
	
	// 订单放款	
	public void loanHandDown(String userId, String creditImg, Long companyId,Long loanId) throws Exception;
	
	//自动放款
	void automaticLoan (String resultPay,String oidPaybill,String orderNo,String downMsg) throws Exception;
}